from tkinter import Tk
from random import random
root = Tk()
root.withdraw()
width, height = root.winfo_screenwidth(), root.winfo_screenheight()


class Utils:

    @staticmethod
    def readFile(filename) -> str:
        with open(filename, "rt", encoding="utf-8") as file:
            return file.read()

    @staticmethod
    def penMove(pen, x: int, y: int) -> None:
        pen.penup()
        pen.goto(x, y)
        pen.pendown()

    @staticmethod
    def penMoveFd(pen, dist: int) -> None:
        pen.penup()
        pen.fd(dist)
        pen.pendown()

    @staticmethod
    def newLine(pen, h: int, beg: int) -> None:
        pen.penup()
        pen.right(90)
        pen.fd(h)
        pen.right(90)
        pen.fd(beg)
        pen.right(180)
        pen.pendown()

    @staticmethod
    def getColor() -> (int, int, int):
        r = random()
        g = random()
        b = random()
        return r, g, b
